Component({
  properties: {
    width: {
      type: Number,
      value: 686,
    },
    height: {
      type: Number,
      value: 360,
    },
    placeholder: {
      type: String,
      value: '填写内容',
    },
    maxlength: {
      type: Number,
      value: -1,
    },
  },

  /**
   * 组件的初始数据
   */
  data: {
    content: '',
  },
  methods: {
    bindinput(e) {
      let content = e.detail.value;
      this.setData({ content });
      this.triggerEvent('getTextarea', { content }, { bubbles: false, composed: false, capturePhase: false });
    },
    deleteText() {
      let content = '';
      wx.showModal({
        title: '温馨提示',
        content: '确认删除?',
        success: (res) => {
          if (res.confirm) {
            this.setData({ content });
            this.triggerEvent('getTextarea', { content }, { bubbles: false, composed: false, capturePhase: false });
          }
        },
      });
    },
  },
});
